<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>资产管理系统</title>
</head>
<link rel="stylesheet" type="text/css" href="js/easyui/themes/gray/easyui.css">
	<link rel="stylesheet" type="text/css" href="js/easyui/themes/icon.css">
	<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="js/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="js/easyui/locale/easyui-lang-zh_CN.js"></script>
	<style type="text/css">
		body {
			font-family: Arial, Helvetica, sans-serif;
			padding: 0;
			margin: 0;
		}
		.cs-north {
			height:68px;background:#eee url(images/head_bg.jpg) repeat-x;
		}
		.cs-north-bg {
			width: 100%;
			height: 100%;
			background: url(js/easyui/themes/gray/images/blank.gif) repeat-x;
		}
		.cs-north-logo {
			height: 40px;
			padding: 15px 0px 0px 5px;
			color:#fff;font-size:22px;font-weight:bold;text-decoration:none
		}
		.cs-west {
			width:200px;padding:0px;border-left:1px solid #99BBE8;
		}
		.cs-south {
			height:25px;background:url('../themes/gray/images/panel_title.gif') repeat-x;padding:0px;text-align:center;
		}
		.cs-navi-tab {
			padding: 5px;
		}
		.cs-tab-menu {
			width:120px;
		}
		.cs-home-remark {
			padding: 10px;
		}
</style>
<script type="text/javascript">
function addTab(title, url){
	if ($('#tabs').tabs('exists', title)){
		$('#tabs').tabs('select', title);//选中并刷新
		var currTab = $('#tabs').tabs('getSelected');
		var url = $(currTab.panel('options').content).attr('src');
		if(url != undefined && currTab.panel('options').title != 'Home') {
			$('#tabs').tabs('update',{
				tab:currTab,
				options:{
					content:createFrame(url)
				}
			})
		}
	} else {
		var content = createFrame(url);
		$('#tabs').tabs('add',{
			title:title,
			content:content,
			closable:true
		});
	}
	tabClose();
}
function createFrame(url) {
	var s = '<iframe scrolling="auto" frameborder="0" src="'+url+'" style="width:100%;height:100%;"></iframe>';
	return s;
}
function tabClose() {
	/*双击关闭TAB选项卡*/
	$(".tabs-inner").dblclick(function(){
		var subtitle = $(this).children(".tabs-closable").text();
		$('#tabs').tabs('close',subtitle);
	})
	/*为选项卡绑定右键*/
	$(".tabs-inner").bind('contextmenu',function(e){
		$('#mm').menu('show', {
			left: e.pageX,
			top: e.pageY
		});
		var subtitle =$(this).children(".tabs-closable").text();
		$('#mm').data("currtab",subtitle);
		$('#tabs').tabs('select',subtitle);
		return false;
	});
}		
//绑定右键菜单事件
function tabCloseEven() {
	//刷新
	$('#mm-tabupdate').click(function(){
		var currTab = $('#tabs').tabs('getSelected');
		var url = $(currTab.panel('options').content).attr('src');
		if(url != undefined && currTab.panel('options').title != 'Home') {
			$('#tabs').tabs('update',{
				tab:currTab,
				options:{
					content:createFrame(url)
				}
			})
		}
	})
	//关闭当前
	$('#mm-tabclose').click(function(){
		var currtab_title = $('#mm').data("currtab");
		$('#tabs').tabs('close',currtab_title);
	})
	//全部关闭
	$('#mm-tabcloseall').click(function(){
		$('.tabs-inner span').each(function(i,n){
			var t = $(n).text();
			if(t != 'Home') {
				$('#tabs').tabs('close',t);
			}
		});
	});
	//关闭除当前之外的TAB
	$('#mm-tabcloseother').click(function(){
		var prevall = $('.tabs-selected').prevAll();
		var nextall = $('.tabs-selected').nextAll();		
		if(prevall.length>0){
			prevall.each(function(i,n){
				var t=$('a:eq(0) span',$(n)).text();
				if(t != 'Home') {
					$('#tabs').tabs('close',t);
				}
			});
		}
		if(nextall.length>0) {
			nextall.each(function(i,n){
				var t=$('a:eq(0) span',$(n)).text();
				if(t != 'Home') {
					$('#tabs').tabs('close',t);
				}
			});
		}
		return false;
	});
	//关闭当前右侧的TAB
	$('#mm-tabcloseright').click(function(){
		var nextall = $('.tabs-selected').nextAll();
		if(nextall.length==0){
			//msgShow('系统提示','后边没有啦~~','error');
			alert('后边没有啦~~');
			return false;
		}
		nextall.each(function(i,n){
			var t=$('a:eq(0) span',$(n)).text();
			$('#tabs').tabs('close',t);
		});
		return false;
	});
	//关闭当前左侧的TAB
	$('#mm-tabcloseleft').click(function(){
		var prevall = $('.tabs-selected').prevAll();
		if(prevall.length==0){
			alert('到头了，前边没有啦~~');
			return false;
		}
		prevall.each(function(i,n){
			var t=$('a:eq(0) span',$(n)).text();
			$('#tabs').tabs('close',t);
		});
		return false;
	});

	//退出
	$("#mm-exit").click(function(){
		$('#mm').menu('hide');
	})
}

$(function() {
	tabCloseEven();
	$('.cs-navi-tab').click(function() {
		var $this = $(this);
		var href = $this.attr('src');
		var title = $this.text();
		addTab(title, href);
	});
});
</script>
<style type="text/css">
ul{
   margin:0px;
   padding:0px;
   padding-top:6px;
   list-style-type:none;
}
.accordion_child {
	font-size:12px;
	height:30px;
	padding:0;
	margin:0;
	display:block;
	width:182px;
	background:url('<%=request.getContextPath()%>/images/second_bg.jpg') 0 bottom no-repeat;
}
.accordion_child a{display:block;padding-left:30px;border-style:none;}
.accordion_child a:link,.accordion_child a:visited {color:#333;text-decoration:none;border-style:none;}
.accordion_child a:hover {color:#f60;border-style:none;}
.accordion_child a.current {
	display:block;
	color:#f00;
	border-style:none;
	background:url('<%=request.getContextPath()%>/images/second_bg.jpg') 0 bottom no-repeat;
</style>
<script>
  $(function(){
	   $('.accordion_child').find('a').click(function(obj) {
		 $('.accordion_child').find('a').removeClass("current");
		 $(this).addClass("current");
		});
	});
</script>

<body class="easyui-layout">
	<div region="north" border="true" class="cs-north">
		<div style="float:left;width:900px;"><img src="images/logo.jpg" width="900" height="62" alt="资产管理系统"/>
    	</div>
    	<div style="float:right;width:330px;height:62px;">
    	</div>
	</div>
	<div region="west" border="true" split="true" title="系统菜单" class="cs-west">
		<div class="easyui-accordion" fit="true" border="false" style="background:#eee">
				<div title="资产登记" selected="true" style="background:#eee">
				  	<ul>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/building.action" class="cs-navi-tab">楼宇管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/room.action" class="cs-navi-tab">房间管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/asset.action" class="cs-navi-tab">资产登记管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/building/test.action" class="cs-navi-tab">楼宇管理2</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/dept_manager.action" class="cs-navi-tab">部门管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/supplier_manager.action" class="cs-navi-tab">供应商管理</a></li>
				  	<li class="accordion_child"><a href="javascript:void(0);" src="newsRelease/addnews.jsp" class="cs-navi-tab">资产贴标</a></li>
				  	<li class="accordion_child"><a href="javascript:void(0);" src="parser3.html" class="cs-navi-tab">资产入库</a></li>
				 	</ul>
				</div>
				<div title="资产管理" style="background:#eee">
					<ul>
				  	<li class="accordion_child"><a href="javascript:void(0);" src="system/adduser.jsp" class="cs-navi-tab">资产领用</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="tabs.html" class="cs-navi-tab">资产归还</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="accordion.html" class="cs-navi-tab">资产变更</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="layout.html" class="cs-navi-tab">资产转移</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="layout.html" class="cs-navi-tab">资产维修</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="layout.html" class="cs-navi-tab">资产报废</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="layout.html" class="cs-navi-tab">资产丢失</a></li>
					</ul>
				</div>
				<div title="资产盘点" style="background:#eee">
				   <ul>
				  	<li class="accordion_child"><a href="javascript:void(0);" src="menu.html" class="cs-navi-tab">快速盘点</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="menubutton.html" class="cs-navi-tab">盘点列表</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="linkbutton.html" class="cs-navi-tab">数据同步</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="splitbutton.html" class="cs-navi-tab">盘点汇总</a></li>
					</ul>
				</div>
				<div title="资产监控" style="background:#eee">
					<ul>
				  	<li class="accordion_child"><a href="javascript:void(0);" src="form.html" class="cs-navi-tab">区域管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="validatebox.html" class="cs-navi-tab">资产定位</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combo.html" class="cs-navi-tab">资产巡检</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combobox.html" class="cs-navi-tab">告警设置管理</a></li>
					</ul>
				</div>
				<div title="统计报表" style="background:#eee">
					<ul>
				  	<li class="accordion_child"><a href="javascript:void(0);" src="form.html" class="cs-navi-tab">组合查询</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="validatebox.html" class="cs-navi-tab">资产清单</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combo.html" class="cs-navi-tab">资产历史</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combobox.html" class="cs-navi-tab">资产统计</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combobox.html" class="cs-navi-tab">报表生成</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combobox.html" class="cs-navi-tab">报表打印</a></li>
					</ul>
				</div>
				<div title="系统管理" style="background:#eee">
					<ul>
					<!-- 
				  	<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/user/usertype_manager.action" class="cs-navi-tab">权限管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/user/index.action" class="cs-navi-tab">用户管理</a></li>
					 -->
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/module.action" class="cs-navi-tab">模块管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/privilege.action" class="cs-navi-tab">权限管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/role.action" class="cs-navi-tab">角色管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/account.action" class="cs-navi-tab">账号管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combo.html" class="cs-navi-tab">系统设置</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combobox.html" class="cs-navi-tab">数据备份</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="combobox.html" class="cs-navi-tab">读写器管理</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="logout.action" class="cs-navi-tab">退出系统</a></li>
					<li class="accordion_child"><a href="javascript:void(0);" src="<%=basePath%>/dc/index.action" class="cs-navi-tab">文档管理</a></li>
					</ul>
				</div>
		</div>
	</div>
	<div id="mainPanle" region="center" border="true" border="false">
		 <div id="tabs" class="easyui-tabs"  fit="true" border="false">
                <div title="Home">
				<div class="cs-home-remark">
					<h1>RFID资产管理系统</h1><br>
					参考资料：<br><br><a href="http://www.jeasyui.com/" target="_blank">easyUi资料</a><br><br>
					<a href="http://docs.jboss.org/hibernate/orm/3.6/reference/zh-CN/html/" target="_blank">Hibernate资料</a><br><br>
					<a href="http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html" target="_blank">springMVC资料</a><br>
				</div>
				</div>
        </div>
	</div>
	<div region="south" border="false" class="cs-south">盛云未来（北京）科技</div>
	<div id="mm" class="easyui-menu cs-tab-menu">
		<div id="mm-tabupdate">刷新</div>
		<div class="menu-sep"></div>
		<div id="mm-tabclose">关闭</div>
		<div id="mm-tabcloseother">关闭其他</div>
		<div id="mm-tabcloseall">关闭全部</div>
	</div>
  </body>
</html>